package com.syqc.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.syqc.entity.DayMile
import com.syqc.monitor.R
import com.syqc.utils.Units

/**
 *@Author Jasper
 *@Time   2020/10/20
 *@Desc   日里程
 */
class DayMileAdapter :
    BaseQuickAdapter<DayMile.MileInfo, BaseViewHolder>(R.layout.item_day_mile) {
    override fun convert(holder: BaseViewHolder, item: DayMile.MileInfo) {
        item.run {
            val num = holder.layoutPosition
            holder.setText(R.id.tvInfoOrder, num.toString())
                .setText(R.id.tvInfoDateType, name)
                .setText(R.id.tvInfoValue, "$mile ${Units.km}")
        }
    }
}